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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: E = None
        self.o: D = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.q: A = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.t: E = None
        self.txt = txt

f = A("f")
g = B("g")
h = C("h")
e = D("e")
d = E("d")
i = D("i")
b = E("b")

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: E = None
        self.o: D = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.q: A = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.t: E = None
        self.txt = txt

f = A("f")
g = B("g")
h = C("h")
e = D("e")
d = E("d")
i = D("i")
b = E("b")

f.z = d
f.w = g
f.r = h
g.o = h
g.z = h
h.x = b
h.w = d
h.o = i
h.u = f
e.v = f
e.w = f
e.q = f
e.y = g
e.o = d
d.x = h
d.v = b
d.t = b
i.v = f
i.w = f
i.q = f
i.y = g
i.o = b
b.x = h
b.v = d
b.t = d
assert i.w.z.v.x.o.o.t.txt == "d"