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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: F = None
        self.w: F = None
        self.o: B = None
        self.x: A = None
        self.txt = txt

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

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

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

j = A("j")
f = B("f")
n = C("n")
d = D("d")
h = E("h")
g = F("g")

j.v = g
f.w = j
f.q = g
f.o = d
n.y = h
n.p = g
n.w = g
n.o = f
n.x = j
d.r = h
h.o = g
h.w = j
h.r = j
h.x = d
h.s = d
h.t = f
g.q = d
g.u = n
assert n.y.r.v.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: F = None
        self.w: F = None
        self.o: B = None
        self.x: A = None
        self.txt = txt

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

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

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

j = A("j")
f = B("f")
n = C("n")
d = D("d")
h = E("h")
g = F("g")

j.v = g
f.w = j
f.q = g
f.o = d
n.y = h
n.p = g
n.w = g
n.o = f
n.x = j
d.r = h
h.o = g
h.w = j
h.r = j
h.x = d
h.s = d
h.t = f
g.q = d
g.u = n
assert n.y.r.v.u.x.txt == "j"