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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

f = A("f")
b = B("b")
h = C("h")
i = D("i")
j = E("j")
l = F("l")
m = F("m")
g = C("g")

f.u = l
f.v = j
b.r = h
b.q = l
b.u = f
b.o = f
b.x = i
b.t = i
h.t = g
h.o = b
h.s = l
h.p = f
h.r = i
i.o = b
i.x = b
i.w = m
j.z = f
l.r = f
m.r = f
g.t = h
g.o = b
g.s = m
g.p = f
g.r = i
assert i.x.q.r.v.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

f = A("f")
b = B("b")
h = C("h")
i = D("i")
j = E("j")
l = F("l")
m = F("m")
g = C("g")

f.u = l
f.v = j
b.r = h
b.q = l
b.u = f
b.o = f
b.x = i
b.t = i
h.t = g
h.o = b
h.s = l
h.p = f
h.r = i
i.o = b
i.x = b
i.w = m
j.z = f
l.r = f
m.r = f
g.t = h
g.o = b
g.s = m
g.p = f
g.r = i
assert i.x.q.r.v.z.v.txt == "j"