class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.u: E = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.x: D = None
        self.y: C = None
        self.w: D = None
        self.u: B = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: H = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: C = None
        self.w: C = None
        self.txt = txt

c = A("c")
f = B("f")
i = C("i")
e = D("e")
m = E("m")
d = F("d")
n = G("n")
k = H("k")
j = B("j")
g = C("g")

c.r = f
c.y = n
c.o = n
c.u = m
f.p = i
f.z = m
f.r = m
f.x = e
f.w = e
f.y = g
f.u = j
f.v = n
i.u = j
e.x = m
e.p = d
m.w = f
m.r = e
m.x = e
d.x = i
d.p = m
d.w = k
n.o = d
n.q = k
n.s = f
k.p = f
k.q = g
k.w = i
j.p = g
j.y = g
j.z = m
j.r = m
j.x = e
j.w = e
j.u = f
j.v = n
g.u = f
assert f.r.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: G = None
        self.u: E = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.x: D = None
        self.y: C = None
        self.w: D = None
        self.u: B = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: E = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: H = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: C = None
        self.w: C = None
        self.txt = txt

c = A("c")
f = B("f")
i = C("i")
e = D("e")
m = E("m")
d = F("d")
n = G("n")
k = H("k")
j = B("j")
g = C("g")

c.r = f
c.y = n
c.o = n
c.u = m
f.p = i
f.z = m
f.r = m
f.x = e
f.w = e
f.y = g
f.u = j
f.v = n
i.u = j
e.x = m
e.p = d
m.w = f
m.r = e
m.x = e
d.x = i
d.p = m
d.w = k
n.o = d
n.q = k
n.s = f
k.p = f
k.q = g
k.w = i
j.p = g
j.y = g
j.z = m
j.r = m
j.x = e
j.w = e
j.u = f
j.v = n
g.u = f
assert f.r.w.z.txt == "m"