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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: A = None
        self.t: E = None
        self.z: A = None
        self.r: C = None
        self.txt = txt

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

g = A("g")
e = B("e")
j = C("j")
c = D("c")
h = E("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: A = None
        self.t: E = None
        self.z: A = None
        self.r: C = None
        self.txt = txt

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

g = A("g")
e = B("e")
j = C("j")
c = D("c")
h = E("h")

g.y = e
e.u = c
j.o = g
j.w = g
c.u = j
c.r = j
c.o = g
c.z = g
c.t = h
h.t = e
h.x = e
h.w = e
h.v = j
h.u = j
assert j.o.y.u.r.o.txt == "g"