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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: E = None
        self.z: B = None
        self.p: F = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: F = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: E = None
        self.z: B = None
        self.p: F = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: F = None
        self.z: A = None
        self.txt = txt

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

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