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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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