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

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

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

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

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

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

a = A("a")
g = B("g")
f = C("f")
e = D("e")
b = E("b")
l = F("l")
d = F("d")
c = D("c")
h = E("h")

a.p = f
g.r = f
g.x = d
g.v = l
f.s = l
f.z = c
f.o = e
f.p = g
e.r = a
e.x = l
b.v = f
b.y = l
b.x = l
b.z = a
b.q = g
b.w = g
l.v = a
l.t = g
l.q = d
l.p = c
d.v = a
d.t = g
d.q = l
d.p = c
c.r = a
c.x = d
h.v = f
h.y = d
h.x = d
h.z = a
h.q = g
h.w = g
assert h.q.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

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

a = A("a")
g = B("g")
f = C("f")
e = D("e")
b = E("b")
l = F("l")
d = F("d")
c = D("c")
h = E("h")

a.p = f
g.r = f
g.x = d
g.v = l
f.s = l
f.z = c
f.o = e
f.p = g
e.r = a
e.x = l
b.v = f
b.y = l
b.x = l
b.z = a
b.q = g
b.w = g
l.v = a
l.t = g
l.q = d
l.p = c
d.v = a
d.t = g
d.q = l
d.p = c
c.r = a
c.x = d
h.v = f
h.y = d
h.x = d
h.z = a
h.q = g
h.w = g
assert h.q.x.v.txt == "a"