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

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

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

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

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

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

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

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

n.u = d
k.w = n
i.v = n
i.o = n
i.p = b
i.r = d
i.t = d
i.x = c
i.u = k
b.s = k
c.w = k
j.y = e
j.t = n
e.w = i
e.s = n
d.v = n
d.o = n
d.p = b
d.r = i
d.t = i
d.x = c
d.u = k
assert b.s.w.u.p.s.w.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

n.u = d
k.w = n
i.v = n
i.o = n
i.p = b
i.r = d
i.t = d
i.x = c
i.u = k
b.s = k
c.w = k
j.y = e
j.t = n
e.w = i
e.s = n
d.v = n
d.o = n
d.p = b
d.r = i
d.t = i
d.x = c
d.u = k
assert b.s.w.u.p.s.w.u.u.txt == "k"