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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: C = None
        self.q: F = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: C = None
        self.q: F = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

i.x = d
i.p = g
d.o = f
d.q = c
c.v = a
c.s = g
n.o = f
n.q = g
n.p = d
n.z = m
n.x = a
n.s = a
g.z = c
g.t = c
g.s = c
g.q = f
a.y = i
m.x = d
m.p = g
f.y = i
assert f.y.p.q.y.x.q.v.txt == "a"