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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.o: D = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

n.x = g
n.v = i
e.x = g
e.q = g
e.v = n
e.y = i
e.p = b
b.q = j
b.o = j
b.p = g
b.y = g
b.s = e
b.z = m
i.s = g
i.q = g
i.x = m
g.s = a
g.q = a
g.o = m
g.w = c
g.z = n
f.x = b
f.q = b
j.x = g
j.q = g
j.v = n
j.y = i
j.p = b
a.x = g
a.v = m
m.s = g
m.q = g
m.x = i
c.x = b
c.q = b
assert g.o.q.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.o: D = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

n.x = g
n.v = i
e.x = g
e.q = g
e.v = n
e.y = i
e.p = b
b.q = j
b.o = j
b.p = g
b.y = g
b.s = e
b.z = m
i.s = g
i.q = g
i.x = m
g.s = a
g.q = a
g.o = m
g.w = c
g.z = n
f.x = b
f.q = b
j.x = g
j.q = g
j.v = n
j.y = i
j.p = b
a.x = g
a.v = m
m.s = g
m.q = g
m.x = i
c.x = b
c.q = b
assert g.o.q.z.v.txt == "i"