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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: F = None
        self.q: E = None
        self.txt = txt

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

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

f.x = n
h.o = a
h.x = a
h.t = i
h.v = i
h.s = f
e.o = d
i.o = e
i.u = e
i.x = h
d.v = h
d.u = a
d.q = n
a.y = e
a.s = e
a.v = i
a.t = b
n.v = b
n.u = a
n.q = d
b.o = a
b.x = a
b.t = i
b.v = i
b.s = f
assert e.o.u.y.o.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: F = None
        self.q: E = None
        self.txt = txt

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

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

f.x = n
h.o = a
h.x = a
h.t = i
h.v = i
h.s = f
e.o = d
i.o = e
i.u = e
i.x = h
d.v = h
d.u = a
d.q = n
a.y = e
a.s = e
a.v = i
a.t = b
n.v = b
n.u = a
n.q = d
b.o = a
b.x = a
b.t = i
b.v = i
b.s = f
assert e.o.u.y.o.q.q.txt == "d"