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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: F = None
        self.o: B = None
        self.v: B = None
        self.w: C = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: A = None
        self.r: A = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: F = None
        self.o: B = None
        self.v: B = None
        self.w: C = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: A = None
        self.r: A = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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