class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: D = None
        self.o: D = None
        self.x: C = None
        self.t: C = None
        self.w: G = None
        self.z: E = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: G = None
        self.z: E = None
        self.q: E = None
        self.u: G = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.t: F = None
        self.w: E = None
        self.z: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: G = None
        self.z: E = None
        self.q: E = None
        self.u: G = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: E = None
        self.t: F = None
        self.w: E = None
        self.z: F = None
        self.txt = txt

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

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