class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.r: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

j.u = i
j.y = c
j.q = c
j.r = n
i.o = f
g.s = c
e.s = g
e.r = i
e.u = i
l.z = n
l.y = e
l.x = j
l.r = j
f.s = i
f.y = i
f.r = g
f.u = a
f.z = l
n.u = i
n.y = e
n.r = a
n.q = c
c.s = g
c.r = i
c.u = i
k.z = n
k.y = c
k.x = j
k.r = a
a.u = i
a.y = c
a.r = j
a.q = e
assert j.r.r.r.r.u.o.u.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.r: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

j.u = i
j.y = c
j.q = c
j.r = n
i.o = f
g.s = c
e.s = g
e.r = i
e.u = i
l.z = n
l.y = e
l.x = j
l.r = j
f.s = i
f.y = i
f.r = g
f.u = a
f.z = l
n.u = i
n.y = e
n.r = a
n.q = c
c.s = g
c.r = i
c.u = i
k.z = n
k.y = c
k.x = j
k.r = a
a.u = i
a.y = c
a.r = j
a.q = e
assert j.r.r.r.r.u.o.u.y.s.txt == "g"