class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: D = None
        self.q: B = None
        self.z: F = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: F = None
        self.o: A = 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: A = None
        self.y: A = None
        self.o: D = None
        self.x: A = None
        self.r: E = None
        self.v: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: D = None
        self.q: B = None
        self.z: F = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: F = None
        self.o: A = 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: A = None
        self.y: A = None
        self.o: D = None
        self.x: A = None
        self.r: E = None
        self.v: D = None
        self.txt = txt

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

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