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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.v: F = None
        self.p: D = None
        self.y: D = None
        self.u: E = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: C = None
        self.u: D = None
        self.p: A = None
        self.w: C = None
        self.s: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: G = None
        self.o: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.v: F = None
        self.p: D = None
        self.y: D = None
        self.u: E = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: C = None
        self.u: D = None
        self.p: A = None
        self.w: C = None
        self.s: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: G = None
        self.o: F = None
        self.txt = txt

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

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