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

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

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

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

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

g = A("g")
d = B("d")
a = C("a")
j = D("j")
i = E("i")
b = E("b")
k = A("k")
m = D("m")
e = B("e")
f = B("f")

g.y = a
g.q = i
d.x = b
d.y = g
d.r = m
d.t = m
a.x = f
a.s = f
a.u = b
a.t = i
a.v = j
j.r = a
j.o = d
j.x = i
i.v = a
i.z = k
b.v = a
b.z = k
k.y = a
k.q = b
m.r = a
m.o = f
m.x = i
e.x = b
e.y = g
e.r = m
e.t = m
f.x = b
f.y = k
f.r = m
f.t = m
assert g.y.x.x.z.y.u.v.t.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.txt = txt

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

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

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

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

g = A("g")
d = B("d")
a = C("a")
j = D("j")
i = E("i")
b = E("b")
k = A("k")
m = D("m")
e = B("e")
f = B("f")

g.y = a
g.q = i
d.x = b
d.y = g
d.r = m
d.t = m
a.x = f
a.s = f
a.u = b
a.t = i
a.v = j
j.r = a
j.o = d
j.x = i
i.v = a
i.z = k
b.v = a
b.z = k
k.y = a
k.q = b
m.r = a
m.o = f
m.x = i
e.x = b
e.y = g
e.r = m
e.t = m
f.x = b
f.y = k
f.r = m
f.t = m
assert g.y.x.x.z.y.u.v.t.z.y.txt == "a"