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

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

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

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

l = A("l")
j = B("j")
a = C("a")
c = D("c")
n = B("n")
e = A("e")
f = C("f")
h = A("h")
g = D("g")

l.q = a
l.z = c
l.p = n
j.r = e
j.o = n
a.u = g
a.x = g
a.t = g
c.z = l
c.x = f
c.u = f
n.r = e
n.o = j
e.q = a
e.z = c
e.p = n
f.u = c
f.x = g
f.t = g
h.q = f
h.z = c
h.p = j
g.z = l
g.x = a
g.u = f
assert l.z.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

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

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

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

l = A("l")
j = B("j")
a = C("a")
c = D("c")
n = B("n")
e = A("e")
f = C("f")
h = A("h")
g = D("g")

l.q = a
l.z = c
l.p = n
j.r = e
j.o = n
a.u = g
a.x = g
a.t = g
c.z = l
c.x = f
c.u = f
n.r = e
n.o = j
e.q = a
e.z = c
e.p = n
f.u = c
f.x = g
f.t = g
h.q = f
h.z = c
h.p = j
g.z = l
g.x = a
g.u = f
assert l.z.u.t.txt == "g"