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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.q: A = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.q: A = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

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

k.x = d
k.q = d
k.u = h
k.r = i
k.v = i
k.p = g
k.o = m
m.q = b
m.r = b
m.u = d
m.p = d
h.y = b
h.q = g
h.t = g
d.t = k
d.w = h
d.u = i
g.o = i
i.w = d
b.w = g
b.y = k
b.q = k
b.t = k
b.v = d
assert h.y.w.o.w.t.txt == "k"