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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.z: B = None
        self.r: A = None
        self.s: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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

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

e = A("e")
k = B("k")
c = C("c")
b = D("b")
f = E("f")
l = F("l")
n = G("n")
d = A("d")

e.r = k
e.s = b
e.y = b
e.p = d
e.q = d
e.t = l
e.u = c
k.u = b
c.y = e
c.r = e
c.t = d
c.z = k
c.s = n
c.w = n
b.v = f
b.u = f
b.o = n
b.y = e
f.y = c
f.p = l
f.z = d
l.w = n
l.x = c
l.t = c
n.x = e
n.s = f
d.r = k
d.s = b
d.y = b
d.p = e
d.q = e
d.t = l
d.u = c
assert c.z.u.y.r.u.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: D = None
        self.y: D = None
        self.p: A = None
        self.t: F = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.z: B = None
        self.r: A = None
        self.s: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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

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

e = A("e")
k = B("k")
c = C("c")
b = D("b")
f = E("f")
l = F("l")
n = G("n")
d = A("d")

e.r = k
e.s = b
e.y = b
e.p = d
e.q = d
e.t = l
e.u = c
k.u = b
c.y = e
c.r = e
c.t = d
c.z = k
c.s = n
c.w = n
b.v = f
b.u = f
b.o = n
b.y = e
f.y = c
f.p = l
f.z = d
l.w = n
l.x = c
l.t = c
n.x = e
n.s = f
d.r = k
d.s = b
d.y = b
d.p = e
d.q = e
d.t = l
d.u = c
assert c.z.u.y.r.u.u.p.txt == "l"