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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.x: F = None
        self.q: E = None
        self.r: E = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

b.r = d
b.o = k
k.q = c
k.t = c
k.x = l
c.z = d
e.z = c
e.s = d
e.v = d
e.o = b
e.x = l
e.r = l
d.v = j
n.t = l
n.z = l
n.w = e
n.x = g
n.q = f
n.r = d
l.w = f
j.t = l
j.z = l
j.w = e
j.x = n
j.q = f
j.r = f
f.v = n
g.t = l
g.z = l
g.w = e
g.x = n
g.q = d
g.r = f
assert e.x.w.v.q.v.q.v.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.x: F = None
        self.q: E = None
        self.r: E = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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