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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: E = None
        self.p: C = None
        self.x: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: A = None
        self.z: G = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: B = None
        self.x: A = None
        self.o: H = None
        self.q: B = None
        self.u: E = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.txt = txt

j = A("j")
c = B("c")
k = C("k")
h = D("h")
l = E("l")
d = F("d")
m = G("m")
f = H("f")

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: E = None
        self.p: C = None
        self.x: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: A = None
        self.z: G = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: B = None
        self.x: A = None
        self.o: H = None
        self.q: B = None
        self.u: E = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.txt = txt

j = A("j")
c = B("c")
k = C("k")
h = D("h")
l = E("l")
d = F("d")
m = G("m")
f = H("f")

j.t = d
j.p = c
j.v = h
j.w = l
c.q = m
c.o = m
c.w = l
c.x = l
c.p = k
k.x = d
k.q = j
k.z = m
k.v = h
k.p = c
h.x = c
h.u = k
l.t = m
l.x = c
l.u = j
d.t = l
d.y = m
m.r = h
m.t = c
m.q = c
m.p = c
m.x = j
m.o = f
m.u = l
f.x = c
f.y = h
assert h.u.x.t.x.q.x.w.t.txt == "m"