class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: E = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: E = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.q: C = None
        self.txt = txt

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

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

n.p = l
n.o = f
b.v = a
b.s = g
b.y = i
b.t = i
f.v = l
f.y = i
f.s = c
f.u = g
a.t = c
a.p = g
a.q = g
i.q = c
i.o = l
i.z = n
c.v = a
c.s = f
c.y = i
c.t = i
j.v = a
j.s = f
j.y = i
j.t = i
l.p = n
l.o = g
g.v = l
g.y = i
g.s = b
g.u = f
assert c.v.t.v.t.v.q.txt == "g"