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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: C = None
        self.u: E = None
        self.y: G = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: A = None
        self.y: A = None
        self.z: E = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: C = None
        self.u: E = None
        self.y: G = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: A = None
        self.y: A = None
        self.z: E = None
        self.r: E = None
        self.txt = txt

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

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