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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: B = None
        self.o: D = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: E = None
        self.z: D = None
        self.v: E = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: B = None
        self.o: D = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: E = None
        self.z: D = None
        self.v: E = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

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