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

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

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

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

e = A("e")
k = B("k")
b = C("b")
g = D("g")
m = D("m")
i = C("i")
d = A("d")
j = A("j")

e.s = k
e.q = m
e.u = g
k.s = j
k.v = g
b.y = e
b.u = i
b.x = j
g.t = m
m.t = g
i.y = j
i.u = b
i.x = e
d.s = k
d.q = g
d.u = g
j.s = k
j.q = m
j.u = m
assert d.s.v.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

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

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

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

e = A("e")
k = B("k")
b = C("b")
g = D("g")
m = D("m")
i = C("i")
d = A("d")
j = A("j")

e.s = k
e.q = m
e.u = g
k.s = j
k.v = g
b.y = e
b.u = i
b.x = j
g.t = m
m.t = g
i.y = j
i.u = b
i.x = e
d.s = k
d.q = g
d.u = g
j.s = k
j.q = m
j.u = m
assert d.s.v.t.t.t.t.t.txt == "m"