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

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

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

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

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

j = A("j")
b = B("b")
g = C("g")
i = D("i")
h = E("h")
c = D("c")
n = A("n")
k = C("k")
l = C("l")

j.q = b
j.z = n
j.t = n
b.w = h
b.y = h
b.z = c
b.v = g
g.u = b
g.x = b
g.z = b
g.p = j
i.r = k
i.s = b
h.y = b
c.r = g
c.s = b
n.q = b
n.z = j
n.t = j
k.u = b
k.x = b
k.z = b
k.p = j
l.u = b
l.x = b
l.z = b
l.p = j
assert g.u.w.y.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

j = A("j")
b = B("b")
g = C("g")
i = D("i")
h = E("h")
c = D("c")
n = A("n")
k = C("k")
l = C("l")

j.q = b
j.z = n
j.t = n
b.w = h
b.y = h
b.z = c
b.v = g
g.u = b
g.x = b
g.z = b
g.p = j
i.r = k
i.s = b
h.y = b
c.r = g
c.s = b
n.q = b
n.z = j
n.t = j
k.u = b
k.x = b
k.z = b
k.p = j
l.u = b
l.x = b
l.z = b
l.p = j
assert g.u.w.y.v.x.txt == "b"