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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.r: F = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.x: A = None
        self.p: B = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

a = A("a")
k = B("k")
d = C("d")
g = D("g")
c = E("c")
f = F("f")
j = A("j")

a.r = g
a.o = d
a.p = d
a.s = j
a.x = j
a.u = k
k.u = c
k.z = j
k.o = d
d.q = g
d.x = g
d.r = f
d.y = k
g.q = f
g.v = f
g.u = a
c.v = f
c.r = f
c.w = d
c.z = d
c.u = j
f.s = c
f.y = c
f.x = a
f.p = k
f.q = d
f.r = d
j.r = g
j.o = d
j.p = d
j.s = a
j.x = a
j.u = k
assert c.r.y.u.o.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: C = None
        self.s: A = None
        self.u: B = None
        self.x: A = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.r: F = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.x: A = None
        self.p: B = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

a = A("a")
k = B("k")
d = C("d")
g = D("g")
c = E("c")
f = F("f")
j = A("j")

a.r = g
a.o = d
a.p = d
a.s = j
a.x = j
a.u = k
k.u = c
k.z = j
k.o = d
d.q = g
d.x = g
d.r = f
d.y = k
g.q = f
g.v = f
g.u = a
c.v = f
c.r = f
c.w = d
c.z = d
c.u = j
f.s = c
f.y = c
f.x = a
f.p = k
f.q = d
f.r = d
j.r = g
j.o = d
j.p = d
j.s = a
j.x = a
j.u = k
assert c.r.y.u.o.x.u.txt == "a"