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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.r: A = None
        self.y: E = None
        self.w: D = 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.q: C = None
        self.txt = txt

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

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

g = A("g")
c = B("c")
h = C("h")
b = D("b")
d = E("d")
e = F("e")
k = D("k")
a = B("a")
n = A("n")

g.s = b
g.z = k
g.p = e
g.v = a
g.t = n
c.z = h
c.s = h
c.r = g
c.y = d
c.w = b
h.o = b
b.q = h
d.q = g
d.v = k
e.q = b
k.q = h
a.z = h
a.s = h
a.r = n
a.y = d
a.w = b
n.s = b
n.z = k
n.p = e
n.v = a
n.t = g
assert b.q.o.q.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.p: F = None
        self.v: B = None
        self.t: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: C = None
        self.r: A = None
        self.y: E = None
        self.w: D = 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.q: C = None
        self.txt = txt

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

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

g = A("g")
c = B("c")
h = C("h")
b = D("b")
d = E("d")
e = F("e")
k = D("k")
a = B("a")
n = A("n")

g.s = b
g.z = k
g.p = e
g.v = a
g.t = n
c.z = h
c.s = h
c.r = g
c.y = d
c.w = b
h.o = b
b.q = h
d.q = g
d.v = k
e.q = b
k.q = h
a.z = h
a.s = h
a.r = n
a.y = d
a.w = b
n.s = b
n.z = k
n.p = e
n.v = a
n.t = g
assert b.q.o.q.o.q.txt == "h"