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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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