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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: F = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: C = None
        self.v: C = None
        self.p: C = None
        self.z: D = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: B = None
        self.u: B = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: F = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: C = None
        self.v: C = None
        self.p: C = None
        self.z: D = None
        self.r: A = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: B = None
        self.u: B = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

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