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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.w: D = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
f = C("f")
m = D("m")
k = E("k")
a = F("a")
d = F("d")
j = C("j")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.w: D = None
        self.r: D = None
        self.v: A = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
f = C("f")
m = D("m")
k = E("k")
a = F("a")
d = F("d")
j = C("j")

l.s = j
i.q = f
f.q = a
f.p = m
f.w = m
f.r = m
f.v = l
m.z = j
m.s = d
m.o = l
k.s = j
k.v = a
a.x = m
a.p = m
a.v = m
a.t = d
a.u = l
a.s = k
d.x = m
d.p = m
d.v = m
d.t = a
d.u = l
d.s = k
j.q = d
j.p = m
j.w = m
j.r = m
j.v = l
assert d.p.z.v.s.r.txt == "m"