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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: A = None
        self.o: F = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

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

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

d = A("d")
g = B("g")
f = C("f")
k = D("k")
h = E("h")
n = F("n")
b = G("b")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: A = None
        self.o: F = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

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

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

d = A("d")
g = B("g")
f = C("f")
k = D("k")
h = E("h")
n = F("n")
b = G("b")

d.o = f
d.s = g
d.r = k
g.y = b
g.t = n
f.t = n
f.v = b
f.z = b
f.x = h
f.o = d
f.p = k
k.t = d
k.q = d
k.v = d
k.s = n
k.r = h
k.y = g
k.p = b
h.w = k
h.t = d
h.o = n
h.x = f
h.s = g
n.u = f
b.v = f
b.z = k
b.r = h
b.s = h
b.t = h
assert d.s.y.v.txt == "f"