class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: D = None
        self.z: A = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: A = None
        self.u: G = None
        self.o: G = None
        self.t: F = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: E = None
        self.txt = txt

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

m.x = a
m.o = f
m.z = b
m.u = g
n.s = g
n.u = g
n.o = g
n.y = b
n.q = b
n.t = a
h.p = f
h.o = j
f.y = b
f.q = h
f.x = m
f.s = a
j.s = g
a.p = n
a.s = g
a.t = g
a.r = m
g.q = h
g.z = j
b.x = a
b.o = f
b.z = m
b.u = g
assert n.t.r.o.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: D = None
        self.z: A = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: A = None
        self.u: G = None
        self.o: G = None
        self.t: F = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: E = None
        self.txt = txt

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

m.x = a
m.o = f
m.z = b
m.u = g
n.s = g
n.u = g
n.o = g
n.y = b
n.q = b
n.t = a
h.p = f
h.o = j
f.y = b
f.q = h
f.x = m
f.s = a
j.s = g
a.p = n
a.s = g
a.t = g
a.r = m
g.q = h
g.z = j
b.x = a
b.o = f
b.z = m
b.u = g
assert n.t.r.o.y.o.txt == "f"