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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: B = None
        self.q: F = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.t: D = None
        self.u: A = None
        self.q: D = None
        self.txt = txt

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

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

l.y = j
l.r = j
d.z = a
d.v = a
d.q = j
d.y = g
m.y = l
m.p = n
m.s = k
n.y = j
n.o = f
n.r = a
e.p = g
e.z = m
e.t = n
e.u = l
e.q = k
j.p = a
j.y = d
k.y = j
k.o = f
k.r = a
a.z = d
a.v = d
a.q = j
a.y = g
g.y = l
g.p = n
g.s = k
f.p = m
f.z = g
f.t = k
f.u = l
f.q = n
assert a.y.s.r.q.p.q.y.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: B = None
        self.q: F = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.t: D = None
        self.u: A = None
        self.q: D = None
        self.txt = txt

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

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

l.y = j
l.r = j
d.z = a
d.v = a
d.q = j
d.y = g
m.y = l
m.p = n
m.s = k
n.y = j
n.o = f
n.r = a
e.p = g
e.z = m
e.t = n
e.u = l
e.q = k
j.p = a
j.y = d
k.y = j
k.o = f
k.r = a
a.z = d
a.v = d
a.q = j
a.y = g
g.y = l
g.p = n
g.s = k
f.p = m
f.z = g
f.t = k
f.u = l
f.q = n
assert a.y.s.r.q.p.q.y.q.y.txt == "d"