class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: E = None
        self.y: D = None
        self.o: C = None
        self.p: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: F = None
        self.o: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: E = None
        self.y: D = None
        self.o: C = None
        self.p: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: F = None
        self.o: D = None
        self.txt = txt

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

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