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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: D = None
        self.txt = txt

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

l.p = h
m.t = l
m.u = k
h.t = k
n.t = c
n.r = l
n.o = l
n.v = l
n.s = m
n.x = m
b.w = l
b.s = m
b.v = c
c.v = n
k.t = l
k.w = n
assert b.v.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: D = None
        self.txt = txt

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

l.p = h
m.t = l
m.u = k
h.t = k
n.t = c
n.r = l
n.o = l
n.v = l
n.s = m
n.x = m
b.w = l
b.s = m
b.v = c
c.v = n
k.t = l
k.w = n
assert b.v.v.t.txt == "c"