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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: D = None
        self.r: A = None
        self.p: A = None
        self.s: A = None
        self.y: F = None
        self.txt = txt

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

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

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

b = A("b")
c = B("c")
g = C("g")
l = D("l")
d = E("d")
j = F("j")
i = A("i")
m = C("m")
f = C("f")

b.z = d
b.v = d
b.q = m
b.o = l
c.p = d
c.o = g
c.r = i
g.t = b
g.r = b
g.p = b
g.u = l
g.s = i
g.y = j
l.o = j
d.r = i
d.s = i
d.u = b
j.z = c
j.x = c
i.z = d
i.v = d
i.q = f
i.o = l
m.t = b
m.r = b
m.s = b
m.u = l
m.p = i
m.y = j
f.t = i
f.r = i
f.s = i
f.u = l
f.p = b
f.y = j
assert f.s.z.u.v.u.o.o.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: E = None
        self.q: C = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: D = None
        self.r: A = None
        self.p: A = None
        self.s: A = None
        self.y: F = None
        self.txt = txt

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

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

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

b = A("b")
c = B("c")
g = C("g")
l = D("l")
d = E("d")
j = F("j")
i = A("i")
m = C("m")
f = C("f")

b.z = d
b.v = d
b.q = m
b.o = l
c.p = d
c.o = g
c.r = i
g.t = b
g.r = b
g.p = b
g.u = l
g.s = i
g.y = j
l.o = j
d.r = i
d.s = i
d.u = b
j.z = c
j.x = c
i.z = d
i.v = d
i.q = f
i.o = l
m.t = b
m.r = b
m.s = b
m.u = l
m.p = i
m.y = j
f.t = i
f.r = i
f.s = i
f.u = l
f.p = b
f.y = j
assert f.s.z.u.v.u.o.o.z.o.txt == "g"