class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.x: G = None
        self.o: B = None
        self.r: E = None
        self.u: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.x: G = None
        self.o: B = None
        self.r: E = None
        self.u: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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