class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: C = None
        self.t: A = None
        self.z: D = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.s: D = None
        self.p: D = None
        self.o: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: E = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: C = None
        self.t: A = None
        self.z: D = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.s: D = None
        self.p: D = None
        self.o: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: E = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

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

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