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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.u: E = None
        self.s: C = None
        self.txt = txt

d = A("d")
k = B("k")
f = C("f")
e = D("e")
h = E("h")
l = F("l")
j = B("j")

d.t = e
d.r = e
d.o = e
d.y = f
k.z = e
k.q = l
f.v = k
f.r = e
f.x = d
f.o = d
e.u = d
e.x = l
e.s = h
h.x = e
h.o = e
h.u = l
h.p = d
h.v = j
l.t = h
l.r = h
l.u = h
l.s = f
j.z = e
j.q = l
assert e.s.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.o: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.u: E = None
        self.s: C = None
        self.txt = txt

d = A("d")
k = B("k")
f = C("f")
e = D("e")
h = E("h")
l = F("l")
j = B("j")

d.t = e
d.r = e
d.o = e
d.y = f
k.z = e
k.q = l
f.v = k
f.r = e
f.x = d
f.o = d
e.u = d
e.x = l
e.s = h
h.x = e
h.o = e
h.u = l
h.p = d
h.v = j
l.t = h
l.r = h
l.u = h
l.s = f
j.z = e
j.q = l
assert e.s.v.z.txt == "e"