class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: E = None
        self.x: B = None
        self.u: C = None
        self.z: C = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

m.v = a
m.t = a
m.w = d
m.x = h
m.u = e
m.z = e
m.o = j
h.x = m
h.o = k
h.t = d
e.y = j
k.u = e
d.y = k
a.w = h
a.u = h
a.o = k
j.z = e
assert a.o.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: E = None
        self.x: B = None
        self.u: C = None
        self.z: C = None
        self.t: F = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: D = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

m.v = a
m.t = a
m.w = d
m.x = h
m.u = e
m.z = e
m.o = j
h.x = m
h.o = k
h.t = d
e.y = j
k.u = e
d.y = k
a.w = h
a.u = h
a.o = k
j.z = e
assert a.o.u.y.txt == "j"