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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: B = None
        self.x: C = None
        self.q: G = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.o: A = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: B = None
        self.x: C = None
        self.q: G = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.o: A = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

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

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