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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.y: F = None
        self.txt = txt

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

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