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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.z: F = None
        self.txt = txt

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

b.u = n
b.w = c
b.o = d
e.o = d
e.t = d
e.v = n
e.s = b
e.w = h
e.r = k
c.t = h
c.o = k
k.v = c
d.r = b
n.p = k
n.z = b
n.s = h
n.o = e
h.t = n
h.s = n
h.z = n
assert n.p.v.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.z: F = None
        self.txt = txt

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

b.u = n
b.w = c
b.o = d
e.o = d
e.t = d
e.v = n
e.s = b
e.w = h
e.r = k
c.t = h
c.o = k
k.v = c
d.r = b
n.p = k
n.z = b
n.s = h
n.o = e
h.t = n
h.s = n
h.z = n
assert n.p.v.o.v.txt == "c"