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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: A = None
        self.y: D = None
        self.v: F = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: A = None
        self.y: D = None
        self.v: F = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

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

d.v = f
d.r = c
d.u = e
c.q = g
m.s = i
m.t = n
m.w = e
g.w = c
g.q = m
e.w = g
e.y = g
e.u = d
e.v = f
e.t = m
e.x = m
f.x = l
n.w = g
n.y = g
n.u = d
n.v = l
n.t = i
n.x = i
b.w = g
b.y = g
b.u = d
b.v = f
b.t = m
b.x = m
l.x = f
i.s = m
i.t = e
i.w = b
assert d.r.q.w.txt == "c"