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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: B = None
        self.t: B = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

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

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

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

j.q = d
i.y = h
i.o = d
c.x = n
c.y = n
c.o = m
c.q = m
m.v = i
m.q = h
m.z = n
m.x = n
m.r = d
m.o = j
m.t = b
h.t = j
d.s = i
d.z = i
d.t = i
d.q = h
d.p = b
n.w = b
n.v = h
n.s = h
n.x = m
b.t = j
assert b.t.q.p.t.q.z.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: B = None
        self.t: B = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

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

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

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

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