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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

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