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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

a = A("a")
h = B("h")
k = C("k")
b = D("b")
n = E("n")
c = F("c")
f = D("f")
d = A("d")
g = A("g")

a.t = b
a.w = k
a.o = c
a.u = g
a.p = n
a.v = f
h.q = c
h.y = k
k.o = a
b.w = f
b.y = g
n.u = h
n.w = g
n.o = c
n.r = d
n.x = a
c.t = h
c.p = b
f.w = b
f.y = d
d.t = f
d.w = k
d.o = c
d.u = g
d.p = n
d.v = b
g.t = f
g.w = k
g.o = c
g.u = a
g.p = n
g.v = b
assert f.w.w.y.o.p.y.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.o: F = None
        self.u: A = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

a = A("a")
h = B("h")
k = C("k")
b = D("b")
n = E("n")
c = F("c")
f = D("f")
d = A("d")
g = A("g")

a.t = b
a.w = k
a.o = c
a.u = g
a.p = n
a.v = f
h.q = c
h.y = k
k.o = a
b.w = f
b.y = g
n.u = h
n.w = g
n.o = c
n.r = d
n.x = a
c.t = h
c.p = b
f.w = b
f.y = d
d.t = f
d.w = k
d.o = c
d.u = g
d.p = n
d.v = b
g.t = f
g.w = k
g.o = c
g.u = a
g.p = n
g.v = b
assert f.w.w.y.o.p.y.p.w.txt == "g"