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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: D = None
        self.v: D = None
        self.w: E = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.s: F = None
        self.o: E = None
        self.t: G = None
        self.u: A = None
        self.txt = txt

l = A("l")
b = B("b")
d = C("d")
k = D("k")
c = E("c")
m = F("m")
n = G("n")
j = H("j")

l.s = n
l.v = n
l.r = m
l.t = c
l.q = b
l.x = k
b.w = n
d.p = k
d.r = l
d.t = c
k.r = j
k.q = j
k.s = m
k.v = m
k.p = n
k.o = d
c.p = b
c.z = d
m.o = c
m.w = c
m.r = k
m.v = k
m.z = j
n.u = m
j.v = c
j.o = c
j.y = m
j.s = m
j.t = n
j.u = l
assert l.q.w.u.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: F = None
        self.v: G = None
        self.t: E = None
        self.q: B = None
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: D = None
        self.v: D = None
        self.w: E = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.s: F = None
        self.o: E = None
        self.t: G = None
        self.u: A = None
        self.txt = txt

l = A("l")
b = B("b")
d = C("d")
k = D("k")
c = E("c")
m = F("m")
n = G("n")
j = H("j")

l.s = n
l.v = n
l.r = m
l.t = c
l.q = b
l.x = k
b.w = n
d.p = k
d.r = l
d.t = c
k.r = j
k.q = j
k.s = m
k.v = m
k.p = n
k.o = d
c.p = b
c.z = d
m.o = c
m.w = c
m.r = k
m.v = k
m.z = j
n.u = m
j.v = c
j.o = c
j.y = m
j.s = m
j.t = n
j.u = l
assert l.q.w.u.r.p.txt == "n"