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

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

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

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

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

b = A("b")
g = B("g")
i = C("i")
a = D("a")
k = E("k")
e = C("e")
j = B("j")

b.p = i
b.q = g
b.y = k
g.u = j
g.r = j
g.x = i
g.w = i
i.w = e
i.x = e
i.t = b
i.v = k
i.u = k
a.w = b
a.u = i
k.x = a
k.s = g
e.w = i
e.x = i
e.t = b
e.v = k
e.u = k
j.u = g
j.r = g
j.x = e
j.w = i
assert a.u.x.t.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

b = A("b")
g = B("g")
i = C("i")
a = D("a")
k = E("k")
e = C("e")
j = B("j")

b.p = i
b.q = g
b.y = k
g.u = j
g.r = j
g.x = i
g.w = i
i.w = e
i.x = e
i.t = b
i.v = k
i.u = k
a.w = b
a.u = i
k.x = a
k.s = g
e.w = i
e.x = i
e.t = b
e.v = k
e.u = k
j.u = g
j.r = g
j.x = e
j.w = i
assert a.u.x.t.q.u.txt == "j"