class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: G = None
        self.q: G = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

b = A("b")
a = B("a")
d = C("d")
l = D("l")
m = E("m")
g = F("g")
f = G("f")
i = H("i")
k = C("k")
n = G("n")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: G = None
        self.q: G = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

b = A("b")
a = B("a")
d = C("d")
l = D("l")
m = E("m")
g = F("g")
f = G("f")
i = H("i")
k = C("k")
n = G("n")

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