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

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

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

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

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

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

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

l.s = j
m.t = b
m.y = b
j.s = m
j.x = l
j.p = l
c.r = n
c.s = l
c.p = l
c.w = l
c.o = m
b.z = j
n.q = i
n.t = i
n.x = i
n.s = i
n.z = i
n.v = c
h.s = m
h.x = l
h.p = l
i.q = n
i.t = n
i.x = n
i.s = n
i.z = n
i.v = c
assert h.s.t.z.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

l.s = j
m.t = b
m.y = b
j.s = m
j.x = l
j.p = l
c.r = n
c.s = l
c.p = l
c.w = l
c.o = m
b.z = j
n.q = i
n.t = i
n.x = i
n.s = i
n.z = i
n.v = c
h.s = m
h.x = l
h.p = l
i.q = n
i.t = n
i.x = n
i.s = n
i.z = n
i.v = c
assert h.s.t.z.p.s.txt == "j"