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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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