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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: A = None
        self.x: E = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.t: A = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: A = None
        self.x: E = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.t: A = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

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

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