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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.u: E = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

b = A("b")
m = B("m")
d = C("d")
e = D("e")
h = E("h")
f = F("f")
j = G("j")

b.w = f
b.u = h
b.p = h
b.s = j
b.q = d
b.x = e
m.u = e
m.p = b
m.x = d
m.y = j
m.s = f
d.y = f
d.p = h
e.r = m
e.w = j
e.u = h
e.t = b
e.s = b
h.z = j
h.v = m
f.x = j
j.y = d
assert m.u.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.s: G = None
        self.q: C = None
        self.p: E = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.u: E = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

b = A("b")
m = B("m")
d = C("d")
e = D("e")
h = E("h")
f = F("f")
j = G("j")

b.w = f
b.u = h
b.p = h
b.s = j
b.q = d
b.x = e
m.u = e
m.p = b
m.x = d
m.y = j
m.s = f
d.y = f
d.p = h
e.r = m
e.w = j
e.u = h
e.t = b
e.s = b
h.z = j
h.v = m
f.x = j
j.y = d
assert m.u.t.w.txt == "f"