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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

g.v = e
g.t = e
g.w = d
g.q = h
g.y = i
d.v = h
d.p = h
b.q = e
b.t = d
b.u = g
e.p = i
h.q = d
h.w = i
h.x = i
i.o = d
i.r = d
i.v = b
i.w = b
i.p = g
assert b.u.w.p.q.v.q.txt == "d"