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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: F = None
        self.txt = txt

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

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

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