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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.y: D = None
        self.z: C = None
        self.r: C = None
        self.txt = txt

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

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

f = A("f")
i = B("i")
j = C("j")
b = D("b")
c = E("c")
h = A("h")
e = C("e")

f.x = i
i.s = c
i.x = c
i.p = f
j.v = c
j.u = e
j.z = e
j.r = e
j.y = b
b.u = j
c.r = i
h.x = i
e.v = c
e.u = j
e.z = j
e.r = j
e.y = b
assert b.u.y.u.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.y: D = None
        self.z: C = None
        self.r: C = None
        self.txt = txt

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

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

f = A("f")
i = B("i")
j = C("j")
b = D("b")
c = E("c")
h = A("h")
e = C("e")

f.x = i
i.s = c
i.x = c
i.p = f
j.v = c
j.u = e
j.z = e
j.r = e
j.y = b
b.u = j
c.r = i
h.x = i
e.v = c
e.u = j
e.z = j
e.r = j
e.y = b
assert b.u.y.u.y.u.txt == "j"