class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: D = None
        self.z: D = None
        self.txt = txt

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

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

d = A("d")
i = B("i")
k = C("k")
f = D("f")
c = E("c")
a = F("a")
n = D("n")
h = B("h")
g = E("g")
l = C("l")

d.v = n
d.x = n
d.q = a
i.p = l
i.r = d
k.y = c
k.u = d
k.w = h
f.v = c
f.t = n
f.z = n
c.u = n
c.q = g
c.p = g
c.x = d
c.t = h
c.z = l
a.u = i
n.v = g
n.t = f
n.z = f
h.p = l
h.r = d
g.u = n
g.q = c
g.p = c
g.x = d
g.t = h
g.z = l
l.y = g
l.u = d
l.w = i
assert i.r.v.v.t.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: D = None
        self.z: D = None
        self.txt = txt

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

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

d = A("d")
i = B("i")
k = C("k")
f = D("f")
c = E("c")
a = F("a")
n = D("n")
h = B("h")
g = E("g")
l = C("l")

d.v = n
d.x = n
d.q = a
i.p = l
i.r = d
k.y = c
k.u = d
k.w = h
f.v = c
f.t = n
f.z = n
c.u = n
c.q = g
c.p = g
c.x = d
c.t = h
c.z = l
a.u = i
n.v = g
n.t = f
n.z = f
h.p = l
h.r = d
g.u = n
g.q = c
g.p = c
g.x = d
g.t = h
g.z = l
l.y = g
l.u = d
l.w = i
assert i.r.v.v.t.r.x.txt == "n"