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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: F = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.q: B = None
        self.s: G = None
        self.txt = txt

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

e.o = k
f.s = m
f.u = m
f.p = h
f.x = e
f.o = k
k.o = d
k.t = h
k.v = f
d.p = k
d.w = k
d.x = m
d.o = h
g.w = m
h.t = f
a.t = k
a.o = d
a.q = f
a.s = j
m.s = f
m.u = f
m.p = h
m.x = e
m.o = k
j.t = k
j.o = d
j.q = m
j.s = a
assert m.o.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: F = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.q: B = None
        self.s: G = None
        self.txt = txt

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

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