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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.w: G = None
        self.r: A = None
        self.z: F = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: C = None
        self.t: E = None
        self.z: C = None
        self.txt = txt

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

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

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

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

b.o = l
b.w = c
f.t = d
f.p = d
f.w = c
f.q = c
f.r = b
f.z = a
l.v = j
j.q = a
j.s = l
j.z = l
j.t = d
d.v = f
d.w = l
a.v = l
a.w = d
a.r = b
c.s = k
n.o = l
n.w = k
k.s = c
assert d.v.p.v.q.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.w: G = None
        self.r: A = None
        self.z: F = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: C = None
        self.t: E = None
        self.z: C = None
        self.txt = txt

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

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

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

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

b.o = l
b.w = c
f.t = d
f.p = d
f.w = c
f.q = c
f.r = b
f.z = a
l.v = j
j.q = a
j.s = l
j.z = l
j.t = d
d.v = f
d.w = l
a.v = l
a.w = d
a.r = b
c.s = k
n.o = l
n.w = k
k.s = c
assert d.v.p.v.q.s.s.s.s.s.txt == "k"