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

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

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

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

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

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

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

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

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

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

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

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

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

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

c.v = i
e.o = n
e.y = l
e.v = l
e.u = l
e.w = l
e.p = m
i.p = j
i.r = m
l.t = n
l.x = i
l.q = i
l.r = h
m.t = c
m.s = h
m.w = j
h.t = l
h.o = d
n.v = i
d.o = c
d.y = l
d.v = l
d.u = l
d.w = l
d.p = m
j.t = c
j.s = h
j.w = m
assert j.w.t.v.txt == "i"