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

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

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

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

g = A("g")
l = B("l")
k = C("k")
h = D("h")
b = B("b")
d = A("d")
m = C("m")
j = D("j")

g.q = h
l.x = b
l.u = j
l.t = m
k.u = b
k.x = m
h.o = b
h.p = m
h.s = d
h.w = k
b.x = l
b.u = j
b.t = m
d.q = j
m.u = b
m.x = k
j.o = l
j.p = k
j.w = k
j.s = g
assert g.q.o.t.u.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

g = A("g")
l = B("l")
k = C("k")
h = D("h")
b = B("b")
d = A("d")
m = C("m")
j = D("j")

g.q = h
l.x = b
l.u = j
l.t = m
k.u = b
k.x = m
h.o = b
h.p = m
h.s = d
h.w = k
b.x = l
b.u = j
b.t = m
d.q = j
m.u = b
m.x = k
j.o = l
j.p = k
j.w = k
j.s = g
assert g.q.o.t.u.t.x.txt == "k"