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

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

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

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

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

g = A("g")
a = B("a")
j = C("j")
k = D("k")
c = E("c")

g.r = c
g.w = a
g.t = j
a.q = j
a.t = c
a.v = g
j.y = k
k.q = j
c.o = j
c.t = j
assert g.t.y.q.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

g = A("g")
a = B("a")
j = C("j")
k = D("k")
c = E("c")

g.r = c
g.w = a
g.t = j
a.q = j
a.t = c
a.v = g
j.y = k
k.q = j
c.o = j
c.t = j
assert g.t.y.q.y.q.txt == "j"