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

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

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

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

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

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

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

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

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

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

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

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

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