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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: D = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.txt = txt

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

b.u = e
b.q = i
g.t = n
g.s = n
g.x = e
g.q = f
g.p = h
g.u = l
f.w = e
f.q = l
h.w = b
h.r = n
h.p = i
e.t = b
i.r = h
i.y = h
j.w = e
j.q = g
l.t = h
l.x = e
l.q = f
l.s = n
l.p = n
l.u = g
m.w = e
m.q = l
n.w = b
n.r = h
n.p = i
assert i.r.w.u.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: D = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.txt = txt

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

b.u = e
b.q = i
g.t = n
g.s = n
g.x = e
g.q = f
g.p = h
g.u = l
f.w = e
f.q = l
h.w = b
h.r = n
h.p = i
e.t = b
i.r = h
i.y = h
j.w = e
j.q = g
l.t = h
l.x = e
l.q = f
l.s = n
l.p = n
l.u = g
m.w = e
m.q = l
n.w = b
n.r = h
n.p = i
assert i.r.w.u.t.q.txt == "i"