class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: A = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = None
        self.s: F = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.s: C = None
        self.txt = txt

f = A("f")
n = B("n")
a = C("a")
b = D("b")
i = E("i")
j = F("j")
e = F("e")
l = F("l")
g = A("g")

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = None
        self.s: F = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.s: C = None
        self.txt = txt

f = A("f")
n = B("n")
a = C("a")
b = D("b")
i = E("i")
j = F("j")
e = F("e")
l = F("l")
g = A("g")

f.x = n
f.t = g
f.v = j
n.r = a
n.s = a
n.z = a
n.q = b
a.w = j
a.t = b
a.s = e
a.q = n
b.p = i
i.t = a
i.y = a
j.o = n
j.p = a
j.s = a
e.o = n
e.p = a
e.s = a
l.o = n
l.p = a
l.s = a
g.x = n
g.t = f
g.v = j
assert j.s.w.o.r.s.o.q.txt == "b"