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

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

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

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

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

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

i = A("i")
m = B("m")
h = C("h")
f = D("f")
n = E("n")
c = F("c")
b = D("b")
a = C("a")
d = D("d")

i.v = c
i.t = d
m.v = d
m.w = n
m.u = n
m.y = i
m.x = c
m.t = c
h.v = i
h.u = c
f.p = i
f.r = a
f.x = n
n.y = f
c.o = m
c.w = n
c.s = d
c.v = i
b.p = i
b.r = a
b.x = n
a.v = i
a.u = c
d.p = i
d.r = h
d.x = n
assert d.r.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

i = A("i")
m = B("m")
h = C("h")
f = D("f")
n = E("n")
c = F("c")
b = D("b")
a = C("a")
d = D("d")

i.v = c
i.t = d
m.v = d
m.w = n
m.u = n
m.y = i
m.x = c
m.t = c
h.v = i
h.u = c
f.p = i
f.r = a
f.x = n
n.y = f
c.o = m
c.w = n
c.s = d
c.v = i
b.p = i
b.r = a
b.x = n
a.v = i
a.u = c
d.p = i
d.r = h
d.x = n
assert d.r.v.v.txt == "c"