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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: E = None
        self.s: F = None
        self.r: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

f.r = h
f.y = h
f.p = h
f.t = g
f.q = k
f.o = k
f.w = j
g.x = k
g.p = e
g.o = m
g.s = j
e.y = h
e.s = h
e.u = h
e.t = g
j.x = k
j.p = k
j.s = m
j.r = h
k.q = m
k.u = e
k.s = j
m.v = h
m.y = h
m.w = k
m.x = e
m.t = f
h.x = f
assert e.t.s.r.x.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: B = None
        self.y: G = None
        self.q: E = None
        self.p: G = None
        self.w: D = None
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: E = None
        self.s: F = None
        self.r: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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