class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.q: D = None
        self.p: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.q: D = None
        self.p: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

i.s = h
h.t = i
h.z = j
h.q = c
h.p = d
j.u = n
j.x = n
j.t = h
c.r = g
c.x = i
g.q = i
g.p = i
g.t = i
g.z = h
g.s = j
g.w = j
g.u = e
g.y = d
e.o = d
e.t = i
n.r = c
d.o = n
assert h.q.x.s.q.x.s.p.txt == "d"