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

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

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

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

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

i = A("i")
b = B("b")
l = C("l")
j = D("j")
f = E("f")
n = D("n")

i.p = n
i.u = n
i.v = l
i.w = f
b.q = l
b.r = l
b.t = l
b.w = i
b.x = j
l.r = i
l.w = j
l.o = j
l.y = f
l.p = f
j.z = n
j.t = i
f.u = l
f.s = b
f.q = j
n.z = j
n.t = i
assert i.v.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.u: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

i = A("i")
b = B("b")
l = C("l")
j = D("j")
f = E("f")
n = D("n")

i.p = n
i.u = n
i.v = l
i.w = f
b.q = l
b.r = l
b.t = l
b.w = i
b.x = j
l.r = i
l.w = j
l.o = j
l.y = f
l.p = f
j.z = n
j.t = i
f.u = l
f.s = b
f.q = j
n.z = j
n.t = i
assert i.v.o.t.txt == "i"