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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.w: G = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: G = None
        self.u: E = None
        self.o: E = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.w: G = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: G = None
        self.u: E = None
        self.o: E = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: F = None
        self.txt = txt

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

f.v = c
g.x = i
i.u = g
i.q = c
i.z = c
i.w = h
l.y = g
j.t = f
j.v = f
j.z = i
c.y = f
c.q = f
c.z = h
c.u = j
c.o = j
c.p = l
h.x = i
h.w = c
assert f.v.u.v.v.z.txt == "h"