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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

l = A("l")
a = B("a")
h = C("h")
g = D("g")
k = C("k")
i = A("i")
c = B("c")

l.s = k
l.q = g
a.s = l
a.y = c
a.p = c
a.r = i
h.x = l
h.t = g
h.v = g
g.v = k
g.z = a
g.x = h
k.x = l
k.t = g
k.v = g
i.s = k
i.q = g
c.s = l
c.y = a
c.p = a
c.r = i
assert k.t.v.v.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

l = A("l")
a = B("a")
h = C("h")
g = D("g")
k = C("k")
i = A("i")
c = B("c")

l.s = k
l.q = g
a.s = l
a.y = c
a.p = c
a.r = i
h.x = l
h.t = g
h.v = g
g.v = k
g.z = a
g.x = h
k.x = l
k.t = g
k.v = g
i.s = k
i.q = g
c.s = l
c.y = a
c.p = a
c.r = i
assert k.t.v.v.x.x.txt == "l"