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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: F = None
        self.x: E = None
        self.w: E = None
        self.s: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

f = A("f")
j = B("j")
c = C("c")
a = D("a")
b = E("b")
h = F("h")
n = C("n")
l = D("l")
i = A("i")
g = F("g")

f.r = j
f.o = i
f.y = b
j.y = l
j.z = h
j.p = h
j.x = b
j.w = b
j.s = g
c.v = f
a.q = c
a.y = i
a.o = b
a.s = f
b.o = j
b.v = j
b.s = j
b.u = h
b.z = i
h.z = b
h.s = a
h.o = n
n.v = i
l.q = n
l.y = f
l.s = f
l.o = b
i.r = j
i.o = f
i.y = b
g.z = b
g.s = a
g.o = n
assert l.y.o.r.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: A = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: F = None
        self.x: E = None
        self.w: E = None
        self.s: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

f = A("f")
j = B("j")
c = C("c")
a = D("a")
b = E("b")
h = F("h")
n = C("n")
l = D("l")
i = A("i")
g = F("g")

f.r = j
f.o = i
f.y = b
j.y = l
j.z = h
j.p = h
j.x = b
j.w = b
j.s = g
c.v = f
a.q = c
a.y = i
a.o = b
a.s = f
b.o = j
b.v = j
b.s = j
b.u = h
b.z = i
h.z = b
h.s = a
h.o = n
n.v = i
l.q = n
l.y = f
l.s = f
l.o = b
i.r = j
i.o = f
i.y = b
g.z = b
g.s = a
g.o = n
assert l.y.o.r.z.s.txt == "a"