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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: G = None
        self.s: C = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

d = A("d")
l = B("l")
m = C("m")
h = D("h")
b = E("b")
c = F("c")
n = G("n")

d.t = n
d.y = l
d.u = l
d.w = b
d.z = m
d.q = h
d.r = c
l.y = h
l.q = n
l.s = m
l.o = m
m.o = h
h.v = n
h.t = b
h.q = b
h.x = m
h.z = m
h.y = l
b.v = m
b.t = c
c.t = l
c.o = d
n.p = b
n.r = d
n.w = m
assert h.y.s.o.z.o.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: B = None
        self.w: E = None
        self.z: C = None
        self.q: D = None
        self.r: F = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: G = None
        self.s: C = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

d = A("d")
l = B("l")
m = C("m")
h = D("h")
b = E("b")
c = F("c")
n = G("n")

d.t = n
d.y = l
d.u = l
d.w = b
d.z = m
d.q = h
d.r = c
l.y = h
l.q = n
l.s = m
l.o = m
m.o = h
h.v = n
h.t = b
h.q = b
h.x = m
h.z = m
h.y = l
b.v = m
b.t = c
c.t = l
c.o = d
n.p = b
n.r = d
n.w = m
assert h.y.s.o.z.o.x.o.txt == "h"