class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.v: G = None
        self.z: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: A = None
        self.s: F = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.u: B = None
        self.r: G = None
        self.o: A = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: A = None
        self.s: F = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.u: B = None
        self.r: G = None
        self.o: A = None
        self.x: E = None
        self.txt = txt

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

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

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