class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.t: E = None
        self.s: F = None
        self.q: F = None
        self.u: B = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: D = None
        self.w: G = None
        self.v: G = None
        self.p: B = None
        self.x: C = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: G = None
        self.r: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: D = None
        self.w: G = None
        self.v: G = None
        self.p: B = None
        self.x: C = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: G = None
        self.r: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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