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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.o: G = None
        self.x: C = None
        self.u: A = None
        self.w: E = None
        self.txt = txt

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

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

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

g.x = l
g.u = l
g.z = n
g.p = n
k.v = l
m.q = g
a.v = g
a.q = g
a.s = g
a.r = e
a.y = e
a.p = k
a.t = n
l.r = e
l.v = f
l.w = f
l.o = n
l.x = m
l.u = g
e.v = g
e.q = g
n.q = g
n.t = g
n.y = m
h.q = g
f.r = e
f.v = l
f.w = l
f.o = n
f.x = m
f.u = g
assert f.u.u.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.p: G = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.o: G = None
        self.x: C = None
        self.u: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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