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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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