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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.o: D = None
        self.q: A = None
        self.t: A = None
        self.r: D = None
        self.txt = txt

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

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

l.s = c
l.v = b
j.z = c
d.x = j
k.z = c
k.s = j
c.p = j
c.v = j
c.o = m
c.q = l
c.t = l
c.r = k
b.v = m
g.x = j
m.z = c
m.s = j
assert d.x.z.r.s.z.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.o: D = None
        self.q: A = None
        self.t: A = None
        self.r: D = None
        self.txt = txt

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

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

l.s = c
l.v = b
j.z = c
d.x = j
k.z = c
k.s = j
c.p = j
c.v = j
c.o = m
c.q = l
c.t = l
c.r = k
b.v = m
g.x = j
m.z = c
m.s = j
assert d.x.z.r.s.z.p.z.txt == "c"