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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

g = A("g")
h = B("h")
c = C("c")
i = D("i")
d = E("d")
n = C("n")
l = A("l")
b = A("b")
f = D("f")

g.u = h
g.y = f
g.t = f
g.r = n
h.o = n
h.u = i
h.t = c
c.v = f
i.x = h
d.y = h
n.v = f
l.u = h
l.y = f
l.t = f
l.r = n
b.u = h
b.y = f
b.r = n
b.t = i
f.x = h
assert b.y.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.r: C = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

g = A("g")
h = B("h")
c = C("c")
i = D("i")
d = E("d")
n = C("n")
l = A("l")
b = A("b")
f = D("f")

g.u = h
g.y = f
g.t = f
g.r = n
h.o = n
h.u = i
h.t = c
c.v = f
i.x = h
d.y = h
n.v = f
l.u = h
l.y = f
l.t = f
l.r = n
b.u = h
b.y = f
b.r = n
b.t = i
f.x = h
assert b.y.x.u.txt == "i"