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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.txt = txt

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

h.v = c
b.z = c
b.o = h
a.y = m
a.q = m
a.w = c
n.u = g
m.s = b
k.p = h
k.o = h
k.u = g
k.t = m
k.y = m
g.x = c
g.p = b
c.y = m
c.q = m
c.w = a
assert b.o.v.w.q.s.o.v.w.txt == "a"