class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: D = None
        self.w: G = None
        self.t: H = None
        self.p: F = None
        self.x: H = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.r: H = None
        self.u: A = None
        self.s: H = None
        self.x: C = None
        self.y: B = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

b = A("b")
d = B("d")
f = C("f")
i = D("i")
j = E("j")
n = F("n")
g = G("g")
c = H("c")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.r: H = None
        self.u: A = None
        self.s: H = None
        self.x: C = None
        self.y: B = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

b = A("b")
d = B("d")
f = C("f")
i = D("i")
j = E("j")
n = F("n")
g = G("g")
c = H("c")

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