class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.w: A = None
        self.u: C = None
        self.txt = txt

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

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

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

h = A("h")
f = B("f")
j = C("j")
d = D("d")
a = C("a")
k = D("k")
g = B("g")
b = D("b")
c = A("c")

h.v = f
h.q = a
h.w = c
h.u = j
f.z = h
j.q = a
j.x = a
j.w = c
d.t = c
d.y = f
d.r = f
a.q = j
a.x = j
a.w = h
k.t = c
k.y = g
k.r = f
g.z = h
b.t = h
b.y = g
b.r = g
c.v = f
c.q = j
c.w = h
c.u = a
assert h.q.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.w: A = None
        self.u: C = None
        self.txt = txt

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

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

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

h = A("h")
f = B("f")
j = C("j")
d = D("d")
a = C("a")
k = D("k")
g = B("g")
b = D("b")
c = A("c")

h.v = f
h.q = a
h.w = c
h.u = j
f.z = h
j.q = a
j.x = a
j.w = c
d.t = c
d.y = f
d.r = f
a.q = j
a.x = j
a.w = h
k.t = c
k.y = g
k.r = f
g.z = h
b.t = h
b.y = g
b.r = g
c.v = f
c.q = j
c.w = h
c.u = a
assert h.q.x.x.x.txt == "j"