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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.q: F = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
c = C("c")
j = D("j")
d = E("d")
g = F("g")
k = B("k")

e.u = j
i.q = g
i.w = j
i.t = d
c.r = d
c.w = d
c.u = d
c.q = g
c.y = e
j.s = d
j.w = i
d.r = i
g.t = c
g.o = e
g.y = e
g.p = k
g.v = j
k.q = g
k.w = j
k.t = d
assert d.r.q.v.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.q: F = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
c = C("c")
j = D("j")
d = E("d")
g = F("g")
k = B("k")

e.u = j
i.q = g
i.w = j
i.t = d
c.r = d
c.w = d
c.u = d
c.q = g
c.y = e
j.s = d
j.w = i
d.r = i
g.t = c
g.o = e
g.y = e
g.p = k
g.v = j
k.q = g
k.w = j
k.t = d
assert d.r.q.v.s.r.txt == "i"