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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.x: D = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.x: D = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

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

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