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

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

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

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

h = A("h")
e = B("e")
f = C("f")
c = D("c")
i = D("i")
m = A("m")
j = C("j")

h.s = e
e.q = c
e.z = f
e.v = i
f.o = h
f.q = m
f.t = j
c.s = f
c.u = f
c.t = m
c.z = e
i.s = f
i.t = h
i.z = e
i.u = j
m.s = e
j.o = h
j.q = m
j.t = f
assert j.q.s.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

h = A("h")
e = B("e")
f = C("f")
c = D("c")
i = D("i")
m = A("m")
j = C("j")

h.s = e
e.q = c
e.z = f
e.v = i
f.o = h
f.q = m
f.t = j
c.s = f
c.u = f
c.t = m
c.z = e
i.s = f
i.t = h
i.z = e
i.u = j
m.s = e
j.o = h
j.q = m
j.t = f
assert j.q.s.z.t.txt == "j"