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

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

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

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

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

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

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

g.u = l
g.w = c
g.r = h
g.q = d
c.u = d
i.v = c
d.w = i
d.t = i
d.o = l
d.u = h
d.q = c
e.v = g
e.q = c
e.z = h
l.t = e
l.u = g
l.s = g
l.p = c
l.q = c
l.r = d
h.v = g
h.q = c
h.z = e
assert i.v.u.o.r.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.r: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

g.u = l
g.w = c
g.r = h
g.q = d
c.u = d
i.v = c
d.w = i
d.t = i
d.o = l
d.u = h
d.q = c
e.v = g
e.q = c
e.z = h
l.t = e
l.u = g
l.s = g
l.p = c
l.q = c
l.r = d
h.v = g
h.q = c
h.z = e
assert i.v.u.o.r.u.v.txt == "g"