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

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

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

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

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

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

e = A("e")
n = B("n")
a = C("a")
j = D("j")
d = E("d")
m = F("m")
g = E("g")

e.y = a
e.z = m
n.u = a
a.r = j
a.w = n
a.v = n
a.y = d
a.s = g
a.x = e
j.z = m
j.q = n
j.p = a
d.u = j
d.t = m
d.q = m
d.x = n
d.v = g
m.o = d
m.r = a
g.u = j
g.t = m
g.q = m
g.x = n
g.v = d
assert j.z.r.y.u.z.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

e = A("e")
n = B("n")
a = C("a")
j = D("j")
d = E("d")
m = F("m")
g = E("g")

e.y = a
e.z = m
n.u = a
a.r = j
a.w = n
a.v = n
a.y = d
a.s = g
a.x = e
j.z = m
j.q = n
j.p = a
d.u = j
d.t = m
d.q = m
d.x = n
d.v = g
m.o = d
m.r = a
g.u = j
g.t = m
g.q = m
g.x = n
g.v = d
assert j.z.r.y.u.z.r.r.txt == "j"