class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.p: C = None
        self.v: G = None
        self.x: C = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: F = None
        self.z: C = None
        self.r: C = None
        self.x: B = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: B = None
        self.x: D = None
        self.y: A = None
        self.s: A = None
        self.txt = txt

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

h.w = c
h.s = c
h.p = c
h.x = c
h.r = c
h.v = i
j.o = c
c.y = d
c.w = j
c.p = f
c.q = f
f.u = j
f.t = j
f.z = c
f.o = c
k.y = h
k.w = h
k.q = d
k.z = c
k.r = c
k.x = j
d.q = c
d.t = h
i.u = c
i.t = j
i.x = f
i.y = h
i.s = h
assert f.u.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.p: C = None
        self.v: G = None
        self.x: C = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: F = None
        self.z: C = None
        self.r: C = None
        self.x: B = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: B = None
        self.x: D = None
        self.y: A = None
        self.s: A = None
        self.txt = txt

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

h.w = c
h.s = c
h.p = c
h.x = c
h.r = c
h.v = i
j.o = c
c.y = d
c.w = j
c.p = f
c.q = f
f.u = j
f.t = j
f.z = c
f.o = c
k.y = h
k.w = h
k.q = d
k.z = c
k.r = c
k.x = j
d.q = c
d.t = h
i.u = c
i.t = j
i.x = f
i.y = h
i.s = h
assert f.u.o.y.txt == "d"