class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
n = C("n")
b = D("b")
k = E("k")
c = F("c")
d = G("d")

e.y = c
e.z = c
e.o = k
e.x = b
h.y = n
h.r = k
n.v = c
n.x = e
n.y = h
n.s = d
n.w = b
b.v = d
k.w = d
k.r = n
k.o = n
k.t = c
c.o = d
d.s = e
d.z = k
d.u = k
d.v = c
d.o = b
d.r = n
assert b.v.r.w.v.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
n = C("n")
b = D("b")
k = E("k")
c = F("c")
d = G("d")

e.y = c
e.z = c
e.o = k
e.x = b
h.y = n
h.r = k
n.v = c
n.x = e
n.y = h
n.s = d
n.w = b
b.v = d
k.w = d
k.r = n
k.o = n
k.t = c
c.o = d
d.s = e
d.z = k
d.u = k
d.v = c
d.o = b
d.r = n
assert b.v.r.w.v.v.o.txt == "d"