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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

i.r = m
i.s = j
i.p = l
c.q = m
j.r = g
k.u = j
k.p = i
k.v = c
k.y = l
m.q = e
m.r = e
m.u = e
m.w = n
m.s = j
m.x = j
l.v = j
e.u = j
e.p = i
e.v = c
e.y = l
n.u = j
n.p = i
n.v = c
n.y = l
g.u = j
g.p = i
g.v = c
g.y = l
assert e.v.q.w.u.txt == "j"