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

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

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

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

i = A("i")
c = B("c")
b = C("b")
f = D("f")
k = C("k")
m = B("m")
d = D("d")
g = B("g")

i.t = b
c.v = k
c.x = f
c.u = b
b.s = c
b.r = f
b.w = k
f.s = b
f.t = b
f.w = i
f.v = i
k.s = g
k.r = d
k.w = b
m.v = b
m.u = b
m.x = d
d.s = k
d.w = i
d.v = i
d.t = b
g.v = k
g.x = f
g.u = b
assert i.t.w.w.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

i = A("i")
c = B("c")
b = C("b")
f = D("f")
k = C("k")
m = B("m")
d = D("d")
g = B("g")

i.t = b
c.v = k
c.x = f
c.u = b
b.s = c
b.r = f
b.w = k
f.s = b
f.t = b
f.w = i
f.v = i
k.s = g
k.r = d
k.w = b
m.v = b
m.u = b
m.x = d
d.s = k
d.w = i
d.v = i
d.t = b
g.v = k
g.x = f
g.u = b
assert i.t.w.w.s.v.txt == "k"