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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.s: A = None
        self.r: C = None
        self.p: D = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: C = None
        self.o: G = None
        self.q: A = None
        self.z: D = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

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

f = A("f")
b = B("b")
j = C("j")
m = D("m")
c = E("c")
h = F("h")
a = G("a")

f.p = m
f.v = c
f.s = j
b.s = f
b.p = h
j.v = b
j.y = h
j.t = h
j.s = h
j.w = a
j.x = m
m.y = a
m.s = a
m.r = h
m.w = j
m.z = b
c.y = m
c.q = m
c.p = m
c.s = f
c.v = f
c.r = j
h.p = a
h.o = a
h.v = j
h.y = j
h.q = f
h.z = m
h.t = c
a.y = c
assert c.v.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: E = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.s: A = None
        self.r: C = None
        self.p: D = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: C = None
        self.o: G = None
        self.q: A = None
        self.z: D = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

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

f = A("f")
b = B("b")
j = C("j")
m = D("m")
c = E("c")
h = F("h")
a = G("a")

f.p = m
f.v = c
f.s = j
b.s = f
b.p = h
j.v = b
j.y = h
j.t = h
j.s = h
j.w = a
j.x = m
m.y = a
m.s = a
m.r = h
m.w = j
m.z = b
c.y = m
c.q = m
c.p = m
c.s = f
c.v = f
c.r = j
h.p = a
h.o = a
h.v = j
h.y = j
h.q = f
h.z = m
h.t = c
a.y = c
assert c.v.s.s.txt == "h"