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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: E = None
        self.txt = txt

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

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

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

i = A("i")
f = B("f")
j = C("j")
d = D("d")
m = E("m")
g = C("g")

i.u = j
f.w = g
f.o = m
j.s = f
j.z = d
j.v = g
d.v = m
m.t = d
g.s = f
g.z = d
g.v = j
assert f.o.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: E = None
        self.txt = txt

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

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

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

i = A("i")
f = B("f")
j = C("j")
d = D("d")
m = E("m")
g = C("g")

i.u = j
f.w = g
f.o = m
j.s = f
j.z = d
j.v = g
d.v = m
m.t = d
g.s = f
g.z = d
g.v = j
assert f.o.t.v.txt == "m"