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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.u: D = None
        self.o: H = None
        self.p: E = None
        self.y: C = None
        self.x: C = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.q: E = None
        self.s: B = None
        self.p: D = None
        self.y: G = None
        self.txt = txt

b = A("b")
d = B("d")
j = C("j")
h = D("h")
l = E("l")
e = F("e")
k = G("k")
n = H("n")
f = C("f")
g = F("g")

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: D = None
        self.u: D = None
        self.o: H = None
        self.p: E = None
        self.y: C = None
        self.x: C = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: C = None
        self.q: E = None
        self.s: B = None
        self.p: D = None
        self.y: G = None
        self.txt = txt

b = A("b")
d = B("d")
j = C("j")
h = D("h")
l = E("l")
e = F("e")
k = G("k")
n = H("n")
f = C("f")
g = F("g")

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