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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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