class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.u: E = None
        self.s: H = None
        self.y: G = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: F = None
        self.t: F = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: B = None
        self.v: G = None
        self.x: D = None
        self.z: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: F = None
        self.p: B = None
        self.v: A = None
        self.txt = txt

c = A("c")
h = B("h")
f = C("f")
e = D("e")
b = E("b")
g = F("g")
a = G("a")
k = H("k")
i = H("i")

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: F = None
        self.t: F = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: B = None
        self.v: G = None
        self.x: D = None
        self.z: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: C = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: F = None
        self.p: B = None
        self.v: A = None
        self.txt = txt

c = A("c")
h = B("h")
f = C("f")
e = D("e")
b = E("b")
g = F("g")
a = G("a")
k = H("k")
i = H("i")

c.t = a
c.y = a
c.w = e
c.u = b
c.s = i
c.v = h
h.q = k
h.r = g
h.t = g
h.x = a
f.t = b
f.w = h
f.v = a
f.x = e
f.z = k
e.z = i
b.p = c
b.t = g
g.t = e
g.r = b
g.x = k
a.r = b
a.o = f
a.y = g
k.u = i
k.o = g
k.p = h
k.v = c
i.u = k
i.o = g
i.p = h
i.v = c
assert e.z.p.q.u.txt == "i"