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

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

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

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

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

f = A("f")
g = B("g")
c = C("c")
l = D("l")
h = E("h")

f.y = c
f.t = c
f.v = g
g.x = h
c.u = f
c.w = l
c.t = l
c.x = g
c.o = g
l.w = f
l.t = f
l.p = h
l.x = h
h.v = f
h.z = f
assert f.t.u.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

f = A("f")
g = B("g")
c = C("c")
l = D("l")
h = E("h")

f.y = c
f.t = c
f.v = g
g.x = h
c.u = f
c.w = l
c.t = l
c.x = g
c.o = g
l.w = f
l.t = f
l.p = h
l.x = h
h.v = f
h.z = f
assert f.t.u.t.u.txt == "f"