class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

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

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

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

j = A("j")
b = B("b")
n = C("n")
i = D("i")
m = B("m")
l = A("l")

j.s = i
j.y = i
j.v = m
b.p = m
b.z = n
b.y = n
n.p = i
n.x = m
n.q = j
i.t = b
m.p = b
m.z = n
m.y = n
l.s = i
l.y = i
l.v = b
assert j.s.t.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

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

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

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

j = A("j")
b = B("b")
n = C("n")
i = D("i")
m = B("m")
l = A("l")

j.s = i
j.y = i
j.v = m
b.p = m
b.z = n
b.y = n
n.p = i
n.x = m
n.q = j
i.t = b
m.p = b
m.z = n
m.y = n
l.s = i
l.y = i
l.v = b
assert j.s.t.p.p.txt == "b"